<?php

namespace App\Services\AppUpgrade;

use App\Models\AppUpgrade;
use App\Models\AppUpgradeModel;
use App\Models\BannerModel;
use App\Models\CategoryModel;
use App\Services\Banner\BannerService;
use Illuminate\Support\Facades\Cache;

class AppUpgradeService
{

    /**
     * APP 升级信息。
     *
     * @return array
     */
    public static function upgrade(): array
    {

            $result = AppUpgradeModel::query()->orderByDesc('id')->first();
            return
                [
                    'upgrade_way' => $result->upgrade_way, //1强制升级 2是正常关闭
                    'app_v' => $result->app_v ?? '1.0.0',
                    'app_title' => $result->app_title ?? 'APP升级提示',
                    'app_desc' =>  explode("\r\n", $result->app_desc??''),
                    'app_url' => $result->url ?? 'APP升级提示',
                ];

    }
}
